let userTexts = document.getElementsByClassName('user-text');
let userPics = document.getElementsByClassName('user-pic');

function show(){
    //排他
    for( let userPic of userPics){
        userPic.classList.remove('active-pic');
    }
    for( let userText of userTexts){
        userText.classList.remove('active-text');
    }

    //获取事件触发对象的索引
    let i =Array.from(userPics).indexOf(event.target);
    // console.log(i);
    userPics[i].classList.add('active-pic');
    userTexts[i].classList.add('active-text');
}




